The petroleum well is a hostile environment with high pressures and temperatures, fluid compositions and fluid management, and vibrations and other movements, which renders measurement-while-drilling (MWD) and logging-while-drilling (LWD) operations challenging and stresses MWD and LWD equipment. In particular, the equipment used for MWD and LWD operations may include heat-producing components such as various electronics that can be vulnerable to the well's hostile environment, particularly the high temperatures. It is useful to be able to dissipate heat from and otherwise protect the electronics so as to improve their life expectancy and reliability in the petroleum well.